package tiled.mapeditor.widget;

import java.awt.*;

import javax.swing.JPanel;

public class ImageViewPanel extends JPanel
{
    private final Image image;

    public ImageViewPanel(Image image)
    {
        this.image = image;
    }

    public Dimension getPreferredSize()
    {
        return new Dimension(150, 150);
    }

    public Dimension getPreferredScrollableViewportSize()
    {
        return getPreferredSize();
    }

    public boolean getScrollableTracksViewportHeight()
    {
        return false;
    }

    public boolean getScrollableTracksViewportWidth()
    {
        return false;
    }

    public void paint(Graphics g)
    {
        g.drawImage(image, 0, 0, null);
    }
}
